from Element import Element
from  Sequence import Sequence

class SeqDB:
    def __init__(self):
        self.seqs=[]
        file_iter = open("D:/python/workspace/irecfyp/trunk/sessions_17_2.txt", 'rU')
        for line in file_iter:
            line = line.strip().rstrip(',')
            record = line.split(',')
            if len(record)>1:
                s=Sequence(1)
                for item in record:
                    s.addElement(Element([item]))
                self.seqs.append(s)
                
#        s.addElement(Element([3]))
#        s.addElement(Element([2]))
#        s.addElement(Element([1]))
#        s.addElement(Element([5])) 
#        self.seqs.append(s)
#        s = Sequence(1)
#        s.addElement(Element([2]))
#        s.addElement(Element([1]))
#        s.addElement(Element([3]))
#        s.addElement(Element([2]))
#        s.addElement(Element([1]))
#        s.addElement(Element([5]))
#        self.seqs.append(s)
#        
#        s = Sequence(1)
#        s.addElement(Element([1]))
#        s.addElement(Element([2]))
#        s.addElement(Element([5]))
#        self.seqs.append(s)
#        
#        s = Sequence(1)
#        s.addElement(Element([1]))
#        s.addElement(Element([2]))
#        s.addElement(Element([5]))
#        s.addElement(Element([2]))
#        s.addElement(Element([4]))
#        self.seqs.append(s)
#        s = Sequence(1)
#        s.addElement(Element([1]))
#        s.addElement(Element([2]))
#        s.addElement(Element([1]))
#        s.addElement(Element([4]))
#        self.seqs.append(s)

    def size(self):
        return len(self.seqs)
    
    def getSeqs(self):
        return self.seqs
